package com.example.library.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@Controller
public class SeatController {

    @GetMapping("/seats")
    public String getSeats(Model model) {
        // 模拟座位数据
        model.addAttribute("seats", List.of(
                new Seat(1, 1, 0),
                new Seat(2, 2, 1),
                new Seat(3, 3, 0)
        ));
        return "seats";
    }
}

class Seat {
    private int id;
    private int seatNumber;
    private int status;

    public Seat(int id, int seatNumber, int status) {
        this.id = id;
        this.seatNumber = seatNumber;
        this.status = status;
    }

    public int getId() {
        return id;
    }

    public int getSeatNumber() {
        return seatNumber;
    }

    public int getStatus() {
        return status;
    }
}